#lang racket

(define (make-interval a b) (cons a b))

(define (lower-bound a) (car a))

(define (upper-bound a) (cdr a))

(define (make-center-width c w)
  (make-interval (- c w) (+ c w)))

(define (center i)
  (/ (+ (lower-bound i) (upper-bound i)) 2))

(define (width i)
  (/ (- (upper-bound i) (lower-bound i)) 2))

(define (make-center-percent c p)
  (make-center-width c (/ (* c p) 100)))

(define (percent i)
  (let ((w (width i))
        (c (center i)))
    (* (/ w c) 100)))

(define i (make-center-width 100 20))

i

(center i)

(width i)

(percent i)

(define ip (make-center-percent 50 6))

ip